<template>
  <el-dialog
    :title="title"
    width="1200%"
    :close-on-click-modal="false"
     v-dialogDrag
    :visible.sync="visible">
    <el-form :model="inputForm" ref="inputForm" :class="method==='view'?'readonly':''"  :disabled="method==='view'" @keyup.enter.native="doSubmit()"
             label-width="120px">
      <el-row  :gutter="20">
        <el-col style="margin-top: 10px;">
         <!--   <el-form-item label="扣押物品 清单" prop="oneId"
                :rules="[
                 ]">
           </el-form-item> -->
                             <div style="text-align: left;">扣押物品 清单</div>
                     <el-select v-model="inputForm.oneId" placeholder="请选择">
                                                             <el-option
                                                               v-for="item in $dictUtils.getDictList('danxuan')"
                                                               :key="item.value"
                                                               :label="item.label"
                                                               :value="item.value">
                                                             </el-option>
                                                           </el-select>

                     </el-radio-group>
                    <el-input v-model="inputForm.wput" ></el-input>
        </el-col>
        <el-col style="margin-top: 10px;">
           <!-- <el-form-item label="检测报告" prop="twoId"
                :rules="[
                 ]">
           </el-form-item> -->
                             <div style="text-align: left;">检测报告</div>
                  <el-select v-model="inputForm.twoId" placeholder="请选择">
                                                          <el-option
                                                            v-for="item in $dictUtils.getDictList('danxuan')"
                                                            :key="item.value"
                                                            :label="item.label"
                                                            :value="item.value">
                                                          </el-option>
                                                        </el-select>

                  </el-radio-group>
                    <el-input v-model="inputForm.wputone" ></el-input>
        </el-col>
        <el-col style="margin-top: 10px;">
           <!-- <el-form-item label="过称单、原油价值说明" prop="threeId"
                :rules="[
                 ]">
           </el-form-item> -->
                             <div style="text-align: left;">过称单、原油价值说明</div>
                  <el-select v-model="inputForm.threeId" placeholder="请选择">
                                                          <el-option
                                                            v-for="item in $dictUtils.getDictList('danxuan')"
                                                            :key="item.value"
                                                            :label="item.label"
                                                            :value="item.value">
                                                          </el-option>
                                                        </el-select>

                  </el-radio-group>
                    <el-input v-model="inputForm.wputtwo" ></el-input>
        </el-col>
        <el-col style="margin-top: 10px;">
           <!-- <el-form-item label="现场勘查及指认照片" prop="fourId"
                :rules="[
                 ]">
           </el-form-item> -->
                             <div style="text-align: left;">现场勘查及指认照片</div>
                     <el-select v-model="inputForm.fourId" placeholder="请选择">
                                                             <el-option
                                                               v-for="item in $dictUtils.getDictList('danxuan')"
                                                               :key="item.value"
                                                               :label="item.label"
                                                               :value="item.value">
                                                             </el-option>
                                                           </el-select>

                     </el-radio-group>
                    <el-input v-model="inputForm.wputthree" ></el-input>
        </el-col>
        <el-col style="margin-top: 10px;">
     <!--       <el-form-item label="发还物品清单、原油回收证明" prop="fiveId"
                :rules="[
                 ]">
           </el-form-item> -->
                             <div style="text-align: left;">发还物品清单、原油回收证明</div>
                    <el-select v-model="inputForm.fiveId" placeholder="请选择">
                                                            <el-option
                                                              v-for="item in $dictUtils.getDictList('danxuan')"
                                                              :key="item.value"
                                                              :label="item.label"
                                                              :value="item.value">
                                                            </el-option>
                                                          </el-select>

                    </el-radio-group>
                    <el-input v-model="inputForm.wputfour" ></el-input>
        </el-col>
        <el-col style="margin-top: 10px;">
<!--            <el-form-item label="涉案车辆权属证明材料" prop="sixId"
                :rules="[
                 ]">
           </el-form-item> -->
                             <div style="text-align: left;">涉案车辆权属证明材料</div>
                      <el-select v-model="inputForm.sixId" placeholder="请选择">
                                                              <el-option
                                                                v-for="item in $dictUtils.getDictList('danxuan')"
                                                                :key="item.value"
                                                                :label="item.label"
                                                                :value="item.value">
                                                              </el-option>
                                                            </el-select>

                      </el-radio-group>
                    <el-input v-model="inputForm.wputfive" ></el-input>
        </el-col>
        <el-col style="margin-top: 10px;">
          <!--  <el-form-item label="丢失报告" prop="selvenId"
                :rules="[
                 ]">
           </el-form-item> -->
                             <div style="text-align: left;">丢失报告</div>
                  <el-select v-model="inputForm.selvenId" placeholder="请选择">
                                                          <el-option
                                                            v-for="item in $dictUtils.getDictList('danxuan')"
                                                            :key="item.value"
                                                            :label="item.label"
                                                            :value="item.value">
                                                          </el-option>
                                                        </el-select>

                  </el-radio-group>
                    <el-input v-model="inputForm.wputsix" ></el-input>
        </el-col>
        <el-col style="margin-top: 10px;">
           <!-- <el-form-item label="犯罪嫌疑人户籍材料" prop="eightId"
                :rules="[
                 ]">
           </el-form-item> -->
                             <div style="text-align: left;">犯罪嫌疑人户籍材料</div>
                    <el-select v-model="inputForm.eightId" placeholder="请选择">
                                                            <el-option
                                                              v-for="item in $dictUtils.getDictList('danxuan')"
                                                              :key="item.value"
                                                              :label="item.label"
                                                              :value="item.value">
                                                            </el-option>
                                                          </el-select>

                    </el-radio-group>
                    <el-input v-model="inputForm.wputselven" ></el-input>
        </el-col>
        <el-col style="margin-top: 10px;">
            <!-- <el-form-item label="犯罪记录 调查证明" prop="nineId"
                :rules="[
                 ]">
           </el-form-item> -->
                      <div style="text-align: left;">犯罪记录 调查证明</div>
                  <el-select v-model="inputForm.nineId" placeholder="请选择">
                                                          <el-option
                                                            v-for="item in $dictUtils.getDictList('danxuan')"
                                                            :key="item.value"
                                                            :label="item.label"
                                                            :value="item.value">
                                                          </el-option>
                                                        </el-select>

                  </el-radio-group>
                    <el-input v-model="inputForm.wputeight" ></el-input>
        </el-col>
        <el-col style="margin-top: 10px;">
           <!-- <el-form-item label="前科材料" prop="tenId"
                :rules="[
                 ]">
           </el-form-item> -->
                             <div style="text-align: left;">前科材料</div>
                       <el-select v-model="inputForm.tenId" placeholder="请选择">
                                                               <el-option
                                                                 v-for="item in $dictUtils.getDictList('danxuan')"
                                                                 :key="item.value"
                                                                 :label="item.label"
                                                                 :value="item.value">
                                                               </el-option>
                                                             </el-select>

                       </el-radio-group>
                    <el-input v-model="inputForm.wputnine" ></el-input>
        </el-col>
        <el-col style="margin-top: 10px;">
         <!--   <el-form-item label="发破案经过" prop="elevenId"
                :rules="[
                 ]">
           </el-form-item> -->
                             <div style="text-align: left;">发破案经过</div>
                     <el-select v-model="inputForm.elevenId" placeholder="请选择">
                                                             <el-option
                                                               v-for="item in $dictUtils.getDictList('danxuan')"
                                                               :key="item.value"
                                                               :label="item.label"
                                                               :value="item.value">
                                                             </el-option>
                                                           </el-select>

                     </el-radio-group>
                    <el-input v-model="inputForm.wputten" ></el-input>
        </el-col>
        <el-col style="margin-top: 10px;">
         <!--   <el-form-item label="抓获经过" prop="twelve"
                :rules="[
                 ]">
           </el-form-item> -->
                             <div style="text-align: left;">抓获经过</div>
                      <el-select v-model="inputForm.twelve" placeholder="请选择">
                                                              <el-option
                                                                v-for="item in $dictUtils.getDictList('danxuan')"
                                                                :key="item.value"
                                                                :label="item.label"
                                                                :value="item.value">
                                                              </el-option>
                                                            </el-select>

                      </el-radio-group>
                    <el-input v-model="inputForm.wputeleven" ></el-input>
        </el-col>
        <el-col style="margin-top: 10px;">
          <!--  <el-form-item label="证人证言" prop="thirtyId"
                :rules="[
                 ]">
           </el-form-item> -->
                             <div style="text-align: left;">证人证言</div>
                     <el-select v-model="inputForm.thirtyId" placeholder="请选择">
                                                             <el-option
                                                               v-for="item in $dictUtils.getDictList('danxuan')"
                                                               :key="item.value"
                                                               :label="item.label"
                                                               :value="item.value">
                                                             </el-option>
                                                           </el-select>

                     </el-radio-group>
                    <el-input v-model="inputForm.wputtwelve" ></el-input>
        </el-col>
        <el-col style="margin-top: 10px;">
           <!-- <el-form-item label="犯罪嫌疑人供述" prop="fourteenId"
                :rules="[
                 ]">
           </el-form-item> -->
                             <div style="text-align: left;">犯罪嫌疑人供述</div>
                     <el-select v-model="inputForm.fourteenId" placeholder="请选择">
                                                             <el-option
                                                               v-for="item in $dictUtils.getDictList('danxuan')"
                                                               :key="item.value"
                                                               :label="item.label"
                                                               :value="item.value">
                                                             </el-option>
                                                           </el-select>

                     </el-radio-group>
                    <el-input v-model="inputForm.wputthirteen" ></el-input>
        </el-col>
        <el-col style="margin-top: 10px;">
           <!-- <el-form-item label="其他证据" prop="fifteenId"
                :rules="[
                 ]">
           </el-form-item> -->
                             <div style="text-align: left;">其他证据</div>
                    <el-select v-model="inputForm.fifteenId" placeholder="请选择">
                                                            <el-option
                                                              v-for="item in $dictUtils.getDictList('danxuan')"
                                                              :key="item.value"
                                                              :label="item.label"
                                                              :value="item.value">
                                                            </el-option>
                                                          </el-select>

                    </el-radio-group>
                    <el-input v-model="inputForm.wputfourteen" ></el-input>
        </el-col>
        </el-row>
    </el-form>
    <span slot="footer" class="dialog-footer">
      <el-button @click="visible = false">关闭</el-button>
      <el-button v-if="method !== 'view'" type="primary" @click="doSubmit()">确定</el-button>
    </span>
  </el-dialog>
</template>

<script>
  export default {
    data () {
      return {
        title: '',
        method: '',
        visible: false,
        oldInputForm: '',
        inputForm: {
          id: '',
          wput: '',
          wputone: '',
          wputtwo: '',
          wputthree: '',
          wputfour: '',
          wputfive: '',
          wputsix: '',
          wputselven: '',
          wputeight: '',
          wputnine: '',
          wputten: '',
          wputeleven: '',
          wputtwelve: '',
          wputthirteen: '',
          wputfourteen: '',
          wputfiveteen: '',
          testDataMain: {
            id: ''
          },
          oneId: '',
          twoId: '',
          threeId: '',
          fourId: '',
          fiveId: '',
          sixId: '',
          selvenId: '',
          eightId: '',
          nineId: '',
          tenId: '',
          elevenId: '',
          twelve: '',
          thirtyId: '',
          fourteenId: '',
          fifteenId: '',
          remarks: ''
        }
      }
    },
    components: {
    },
    watch: {
      // 路径改变时候 关闭组件bug
      $route (newVal, oldVal) {
        this.visible = false
      }
    },
    methods: {
      init (method, obj) {
        this.method = method
        if (method === 'add') {
          this.title = `新建掩饰隐瞒犯罪所得罪证据指引`
        } else if (method === 'edit') {
          this.title = '修改掩饰隐瞒犯罪所得罪证据指引'
        } else if (method === 'view') {
          this.title = '查看掩饰隐瞒犯罪所得罪证据指引'
        }
        this.visible = true
        this.$nextTick(() => {
          this.$refs.inputForm.resetFields()
          this.inputForm.id = ''
          this.oldInputForm = ''
          if (method === 'edit' || method === 'view') { // 修改或者查看
            this.oldInputForm = obj
            this.inputForm = JSON.parse(JSON.stringify(obj))
          }
        })
      },
   // 表单提交
      doSubmit () {
        this.$refs['inputForm'].validate((valid) => {
          if (valid) {
            this.$emit('addRow', this.oldInputForm, JSON.parse(JSON.stringify(this.inputForm)))
     // if (this.inputForm.wput === '' | this.inputForm.wputone === '' | this.inputForm.wputtwo === '' | this.inputForm.wputthree === '' | this.inputForm.wputfour === '' | this.inputForm.wputfive === '' | this.inputForm.wputsix === '' | this.inputForm.wputselven === '' | this.inputForm.wputeight === '' | this.inputForm.wputnine === '' | this.inputForm.wputten === '' | this.inputForm.wputeleven === '' | this.inputForm.wputtwelve === '' | this.inputForm.wputthirteen === '' | this.inputForm.wputfourteen === '') {
     //   console.log(this.inputForm)
     // } else {
     // }

       if ((this.inputForm.oneId === '1' | this.inputForm.wput !== '') & (this.inputForm.twoId === '1' | this.inputForm.wputone !== '') & (this.inputForm.threeId === '1' | this.inputForm.wputtwo !== '') & (this.inputForm.fourId === '1' | this.inputForm.wputthree !== '') & (this.inputForm.fiveId === '1' | this.inputForm.wputfour !== '') & (this.inputForm.sixId === '1' | this.inputForm.wputfive !== '') & (this.inputForm.selvenId === '1' | this.inputForm.wputsix !== '') & (this.inputForm.eightId === '1' | this.inputForm.wputselven !== '') & (this.inputForm.nineId === '1' | this.inputForm.wputeight !== '') & (this.inputForm.tenId === '1' | this.inputForm.wputnine !== '') & (this.inputForm.elevenId === '1' | this.inputForm.wputten !== '') & (this.inputForm.twelve === '1' | this.inputForm.wputeleven !== '') & (this.inputForm.thirtyId === '1' | this.inputForm.wputtwelve !== '') & (this.inputForm.fourteenId === '1' | this.inputForm.wputthirteen !== '') & (this.inputForm.fifteenId === '1' | this.inputForm.wputfourteen !== '')) {
         this.$emit('axx', '齐全')
       } else if (((this.inputForm.oneId === '' | this.inputForm.oneId === '2') & this.inputForm.wput === '') | ((this.inputForm.twoId === '' | this.inputForm.twoId === '2') & this.inputForm.wputone === '') | ((this.inputForm.threeId === '' | this.inputForm.threeId === '2') & this.inputForm.wputtwo === '') | ((this.inputForm.fourId === '' | this.inputForm.fourId === '2') & this.inputForm.wputthree === '') | ((this.inputForm.fiveId === '' | this.inputForm.fiveId === '2') & this.inputForm.wputfour === '') | ((this.inputForm.sixId === '' | this.inputForm.sixId === '2') & this.inputForm.wputfive === '') | ((this.inputForm.selvenId === '' | this.inputForm.selvenId === '2') & this.inputForm.wputsix === '') | ((this.inputForm.eightId === '' | this.inputForm.eightId === '2') & this.inputForm.wputselven === '') | ((this.inputForm.nineId === '' | this.inputForm.nineId === '2') & this.inputForm.wputeight === '') | ((this.inputForm.tenId === '' | this.inputForm.tenId === '2') & this.inputForm.wputnine === '') | ((this.inputForm.elevenId === '' | this.inputForm.elevenId === '2') & this.inputForm.wputten === '') | ((this.inputForm.twelve === '' | this.inputForm.twelve === '2') & this.inputForm.wputeleven === '') | ((this.inputForm.thirtyId === '' | this.inputForm.thirtyId === '2') & this.inputForm.wputtwelve === '') | ((this.inputForm.fourteenId === '' | this.inputForm.fourteenId === '2') & this.inputForm.wputthirteen === '') | ((this.inputForm.fiveteenId === '' | this.inputForm.fiveteenId === '2') & this.inputForm.wputfourteen === '')) {
     this.$emit('axx', '不齐全')
       }
            this.visible = false
          }
        })
        this.$emit('values', 1)
      },
      continueDoSubmit () {
          console.log(123)
        this.$refs['inputForm'].validate((valid) => {
          if (valid) {
            this.$emit('addRow', this.oldInputForm, JSON.parse(JSON.stringify(this.inputForm)))
    if ((this.inputForm.oneId === '1' | this.inputForm.wput !== '') & (this.inputForm.twoId === '1' | this.inputForm.wputone !== '') & (this.inputForm.threeId === '1' | this.inputForm.wputtwo !== '') & (this.inputForm.fourId === '1' | this.inputForm.wputthree !== '') & (this.inputForm.fiveId === '1' | this.inputForm.wputfour !== '') & (this.inputForm.sixId === '1' | this.inputForm.wputfive !== '') & (this.inputForm.selvenId === '1' | this.inputForm.wputsix !== '') & (this.inputForm.eightId === '1' | this.inputForm.wputselven !== '') & (this.inputForm.nineId === '1' | this.inputForm.wputeight !== '') & (this.inputForm.tenId === '1' | this.inputForm.wputnine !== '') & (this.inputForm.elevenId === '1' | this.inputForm.wputten !== '') & (this.inputForm.twelve === '1' | this.inputForm.wputeleven !== '') & (this.inputForm.thirtyId === '1' | this.inputForm.wputtwelve !== '') & (this.inputForm.fourteenId === '1' | this.inputForm.wputthirteen !== '') & (this.inputForm.fifteenId === '1' | this.inputForm.wputfourteen !== '')) {
        this.$emit('axx', '齐全')
      } else if (((this.inputForm.oneId === '' | this.inputForm.oneId === '2') & this.inputForm.wput === '') | ((this.inputForm.twoId === '' | this.inputForm.twoId === '2') & this.inputForm.wputone === '') | ((this.inputForm.threeId === '' | this.inputForm.threeId === '2') & this.inputForm.wputtwo === '') | ((this.inputForm.fourId === '' | this.inputForm.fourId === '2') & this.inputForm.wputthree === '') | ((this.inputForm.fiveId === '' | this.inputForm.fiveId === '2') & this.inputForm.wputfour === '') | ((this.inputForm.sixId === '' | this.inputForm.sixId === '2') & this.inputForm.wputfive === '') | ((this.inputForm.selvenId === '' | this.inputForm.selvenId === '2') & this.inputForm.wputsix === '') | ((this.inputForm.eightId === '' | this.inputForm.eightId === '2') & this.inputForm.wputselven === '') | ((this.inputForm.nineId === '' | this.inputForm.nineId === '2') & this.inputForm.wputeight === '') | ((this.inputForm.tenId === '' | this.inputForm.tenId === '2') & this.inputForm.wputnine === '') | ((this.inputForm.elevenId === '' | this.inputForm.elevenId === '2') & this.inputForm.wputten === '') | ((this.inputForm.twelve === '' | this.inputForm.twelve === '2') & this.inputForm.wputeleven === '') | ((this.inputForm.thirtyId === '' | this.inputForm.thirtyId === '2') & this.inputForm.wputtwelve === '') | ((this.inputForm.fourteenId === '' | this.inputForm.fourteenId === '2') & this.inputForm.wputthirteen === '') | ((this.inputForm.fiveteenId === '' | this.inputForm.fiveteenId === '2') & this.inputForm.wputfourteen === '')) {
    this.$emit('axx', '不齐全')
      }

            this.$refs['inputForm'].resetFields()
          }
        })
      }
    }
  }
</script>
